﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _03_栈
{
    class Program
    {
        static void Main(string[] args)
        {
            var charitem = new Stack<char>();//栈：先进后出
            charitem.Push('A');
            charitem.Push('B');
            charitem.Push('C');
            charitem.Push('D');
            charitem.Push('E');
            foreach (var item in charitem)
            {
                Console.WriteLine(item);
            }
            while (charitem.Count>0)
            {
                Console.WriteLine(charitem.Pop());
            }
            Console.ReadKey();
        }
    }
}
